<template>
	<div class="study_list_wrapper webheart">
		<template v-if="examClassList.length > 0">
			<list-card v-for="(item, index) in examClassList" :key="index" :data="item"></list-card>
		</template>
		<template v-else>
			<el-empty :image-size="120"></el-empty>
		</template>
	</div>
</template>

<script>
import listCard from './listCard';
export default {
	components: { listCard },
	data() {
		return {
			examClassList: []
		};
	},
	mounted() {
		this.getExamClassList();
		window.addEventListener('visibilitychange', () => {
			if (document.visibilityState === 'visible') {
				this.getExamClassList();
			}
		});
	},
	methods: {
		//获取考试分类
		async getExamClassList() {
			let params = { pid: 0, classType: 2, status: 1 };
			let result = await this.$store.dispatch('sysClassifyList', params);
			if (result.code === '0') {
				this.examClassList = result.data || [];
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.study_list_wrapper::v-deep {
	max-width: 1400px;
	padding-bottom: 40px !important;
	margin: 0 auto;
}
</style>
